<template>
	<!-- 领取礼包的订单详情 -->
	<view class="orderdetailes">
		<view class="subinformation">
			
			<view class="subin_top">
				<view class="subatop_left">
					<view class="subatop_first">
						<view class="top_picture">
							<view class="bigcircle">
								<view class="middlecircle"></view>
							</view>
						</view>
						<view class="subatop_already" v-if="source==1">
							{{order_infodata.status}}
						</view>	
						<view class="subatop_already" v-if="source==2">
							{{order_infodata.pl_status}}
						</view>
					</view>
				</view>
			</view>
				
			<view class="subin_middle">
				<view class="subinfor_info">
					<image v-if="source==1" class="subinfor_img" :src="photo_cdn1+'zpupload/20230720/482f6631a2445d82c6.png'" ></image>
					<image v-if="source==2" class="subinfor_img" :src="photo_cdn1+order_infodata.photo"></image>
					<view class="subinfor_right">
						<view class="subinfor_title">
							<view class="title_text">{{order_infodata.memo}}</view>
							<view class="title_text"></view>
						</view>
						<view class="subinfor_num">
							<view class="num_text" v-if="source==1">￥{{order_infodata.payamount}}</view>
							<view class="num_text" v-if="source==2">￥{{order_infodata.price}}</view>
							<view class="num_text">× 1</view>
						</view>
					</view>	
				</view>
				<view class="subindent_info">
					<view class="subindent_title">订单明细</view>
					
					<view class="subindent_price">
						<view class="textprice">下单时间</view>
						<view class="numprice_a" v-if="source==1">{{order_infodata.createtime  | parsetime}}</view>
						<view class="numprice_a" v-if="source==2">{{order_infodata.createtime}}</view>
					</view>
					
					<view class="subindent_price">
						<view class="textprice">订单编号</view>
						<view class="numprice_a">{{order_infodata.order_sn }}</view>
					</view>
					
					<view class="divider"></view>
					
					
					<!-- <view class="divider"></view> -->
					
					<view class="subindent_price">
						<view class="textprice">合计</view>
						<view class="numprice" v-if="source==1">￥{{order_infodata.payamount}}</view>
						<view class="numprice" v-if="source==2">￥{{order_infodata.price}}</view>
					</view>
				</view>	
			</view>
				
			<!-- <view class="subinfor_account"> -->
				<!-- <view class="subinfor_btn">联系客服</view>
				<view class="subinfor_btn">取消订单</view> -->
				
				<!-- <view class="subinfor_btn" v-show="btn_item.way!='orderDetails'" @tap="ordertimetap(order_infodata,btn_item)" :class="btn_item.class_name" v-for="(btn_item,index) in order_infodata.order_operation">{{btn_item.name}}</view> -->
			<!-- </view> -->
			
		</view>
	</view>
</template>

<script>
	import {getRechargeDetail,worshipOrderDetail} from "@/utils/api/order.js";
	import config from "@/utils/config.js";
	let {staticurl,photo_cdn1} = config.baseUrl;
	export default {
		data(){
			return {
				staticurl,
				photo_cdn1,
				order_id:"",
				source:'',//1 族谱订单 2//祭拜订单
				order_infodata:{},
			}
		},
		onLoad(Option) {
			this.order_id = Option.order_id?Option.order_id:"";
			this.source = Option.source?Option.source:'';
			
			if(this.source==1){
				this.orderDetailsfun();
			}else if(this.source==2){
				this.worshipOrderDetailfun();
			}
			
		},
		methods:{
			//获取订单详情
			orderDetailsfun(){
				getRechargeDetail({
					order_id:this.order_id,
				}).then((res)=>{
					if(res.code==1){
						this.order_infodata = res.data.detail;
					}else{
						this.$api.msg(res.msg);
					}
				})
			},
			//贡品订单详情
			worshipOrderDetailfun(){
				worshipOrderDetail({
					order_id:this.order_id,
				}).then(res=>{
					if(res.code==1){
						this.order_infodata = res.data.order_detail;
					}else{
						this.$api.msg(res.msg);
					}
				})
			},
			//点击按钮
			ordertimetap(dataitem,btn_item){
				if(btn_item.way=='orderDetails'){
					//订单详情
					
				}else if(btn_item.way=='affirmReceiving'){
					
				}else if(btn_item.way=='checkLogistics'){
					
				}
			},
			
		}
	}
</script>

<style lang="scss">
	@import "./my_order_detaile.scss";
</style>